<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 500px;
            height: 500px;
            border: 3px solid violet;
            transform-style: preserve-3d;
            position: relative;
            margin: 0 auto;
            background-color: orangered;
            box-sizing: border-box;
            display: flex;

            /* transform: rotateX(30deg); */
            perspective: 900px;

        }
        .center{
            position: absolute;
            width: 100px;
            height: 100px;
            left: 50%;
            top: 50%;
            margin-left: -50px;
            margin-top: -50px;
            border: 2px dashed skyblue;
            box-sizing: border-box;
            background-color: palegreen;

            transform: translate3d(0px, 0px, 200px);
        }
        .center2{
            /* position: absolute; */
            width: 200px;
            height: 200px;
            margin: auto;
            /* left: 50%;
            top: 50%; */
            /* margin-left: -50px;
            margin-top: -50px; */
            border: 2px solid magenta;
            background-color: blue;
            
            /* transform: rotateX(30deg);
            transform: rotateY(30deg); */
            /* transform: rotate3d(1, 1, 1, 30deg); */
            /* transform: translateZ(-100px);    */
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="center"></div>
        <div class="center2"></div>
    </div>
</body>
</html>